﻿
Partial Class adminpanel_UserAdd
    Inherits System.Web.UI.Page
    Private User As Pic.Users
    Private UserEmail As String
    Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
        Dim qs As New Pic.SecureQueryString(Request.QueryString("id"))
        UserEmail = qs.Item(0).ToString
        If Not IsPostBack Then
            fillUser()
        End If
    End Sub
    Private Sub fillUser()
        If UserEmail = "" Then

        Else
            User = Pic.Users.GetUserByEmail(UserEmail)
            With User
                txtemail.Text = .Email
                txtname.Text = .Name
                txtsurname.Text = .Surname
                txtcreated.Text = .Created
                txtmodified.Text = .Modified
            End With
        End If
    End Sub

    Protected Sub submit_Click(sender As Object, e As System.EventArgs) Handles submit.Click
        If UserEmail = "" Then
        Else
            Pic.Users.UpdateUser(txtemail.Text, txtname.Text, txtsurname.Text, "")
        End If
    End Sub
End Class
